package smetana.domain.raw;

import com.google.common.base.Preconditions;
import smetana.domain.AbstractEntity;

import static org.apache.commons.lang.StringUtils.defaultString;

public class PositionUnit  extends AbstractEntity {
    private int id;
    private String unitName;
    private boolean isAtomic;

    protected PositionUnit(){
        //used by iBatis.
    }

    public PositionUnit(int id){
        this.id = id;
    }

    @Override
    public int getId(){
        return this.id;
    }

    public void setId(int id){
        this.id = id;
    }
    public String getUnitName(){
        return defaultString(this.unitName);
    }

    public void setUnitName(String unitName){
        this.unitName = Preconditions.checkNotNull(unitName);
    }
    public boolean getIsAtomic(){
        return this.isAtomic;
    }

    public void setIsAtomic(boolean isAtomic){
        this.isAtomic = isAtomic;
    }
}